package com.co.notaweb.entities.system;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

import com.co.notaweb.enums.RolEnum;

@Entity
@NamedQueries({ @NamedQuery(name = "Rol.consultarAllRoles", query = "SELECT r FROM Rol r") })
public class Rol {

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private long id;

	@Enumerated(EnumType.STRING)
	private RolEnum rolname;

	@ManyToMany(fetch = FetchType.EAGER)
	private List<Usuario> usuarios;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public RolEnum getRolname() {
		return rolname;
	}

	public void setRolname(RolEnum rolname) {
		this.rolname = rolname;
	}

	public List<Usuario> getUsuarios() {
		return usuarios;
	}

	public void setUsuarios(List<Usuario> usuarios) {
		this.usuarios = usuarios;
	}

}
